import { gooItemCateApi } from './api'
import axios from 'axios'

export default {
  addOne(gooItemCate) {
    return axios({
      method: 'post',
      url: gooItemCateApi.addOneUrl(),
      data: gooItemCate,
      withCredentials: true
    })
  },
  updateOne(cateId,gooItemCate) {
    return axios({
      method: 'put',
      url: gooItemCateApi.updateOneUrl(cateId),
      data: gooItemCate,
      withCredentials: true
    })
  },
  getOne(cateId) {
    return axios({
      method: 'get',
      url: gooItemCateApi.getOneUrl(cateId),
      withCredentials: true
    })
  },
  getList() {
    return axios({
      method: 'get',
      url: gooItemCateApi.getListUrl(),
      withCredentials: true
    })
  }, 
  search(keywords) {
    return axios({
      method: 'get',
      url: gooItemCateApi.searchUrl(keywords),
      withCredentials: true
    })
  },
  deleteOne(cateId) {
    return axios({
      method: 'delete',
      url: gooItemCateApi.deleteOneUrl(cateId),
      withCredentials: true
    })
  },
}
